package com.qiaofang.applet.service.property.service.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;

@Data
@ApiModel("二手房房源详情DTO")
public class SalePropertyDetailDto extends PropertyDetailDto {

    @ApiModelProperty("售价")
    private BigDecimal sellPrice;

    @ApiModelProperty("售单价")
    private BigDecimal sellUnitPrice;

    @ApiModelProperty("房源状态 在售/已售")
    private String tradeStatusName;

    public String getTradeStatusName() {
        if (StringUtils.isNotBlank(getTradeStatus())) {
            if (getTradeStatus().equals("有效")) {
                tradeStatusName = "在售";
            } else if (getTradeStatus().equals("已售")) {
                tradeStatusName = "已售";
            } else {
                tradeStatusName = "暂无状态";
            }
        } else {
            tradeStatusName = "暂无状态";
        }
        return tradeStatusName;
    }
}
